function reverseWords(s: string): string {
    const str = s.split(' ');
    const reult = str.map((word) => {
        let result = '';
        // console.log(word.length);
        for (let i = word.length - 1; i >= 0; i--) {
            // console.log(result);
            result += word[i];
        }
        // console.log(result);
        return result;
    })
    // console.log(reult);
    return reult.join(' ');
};

const str2 = "Let's take LeetCode contest";
reverseWords(str2);